#include "Panel.h"

Panel::Panel() : size(2)
{
    panelSprite.SetTexture(rm->getTexture("Panel.png"));
    w = panelSprite.GetGlobalBounds().Width;
    h = panelSprite.GetGlobalBounds().Height;
}

Panel::~Panel()
{
    //dtor
}

void Panel::update(int x)
{
    panelSprite.SetPosition(x - panelSprite.GetGlobalBounds().Width/2, HEIGHT - 16);
}

void Panel::move(float delta)
{
    panelSprite.SetPosition(panelSprite.GetGlobalBounds().Left + delta, HEIGHT - 16);
}

void Panel::draw(sf::RenderWindow* window)
{
    window->Draw(panelSprite);
}

void Panel::setPosition(float x, float y)
{
    panelSprite.SetPosition(x-panelSprite.GetGlobalBounds().Width/2, y);
}

